-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add psycopg3 support #131
base: master
Are you sure you want to change the base?
Add psycopg3 support #131
Conversation
A PR to fix CI would be appreciated; I have very little time to maintain this project. |
Sure - I'll open a new PR to remove Python 3.5, 3.6, 3.7 and add 3.11. As well as test only currently supported django versions. We should wait on Django 4.2 CI until it's released. If there is an easy way to run the tests locally, please let me know. I'm only testing by pushing to github for CI or running on my own project and poking around. |
@bufke to what extent have you investigate whether there's a psycopg3 feature replacing this adapters feature? @mateuszmandera @andersk it'd be great if you can help review this as well. |
There are still adapters but they appear to be entirely different. See docs. I know very little about psycopg and didn't know what an adapter was until I tried Django 4.2.
All I did to test was click around in django admin. I was able to manipulate a bitfield field after omitting the adapter. More testing would be great and it should be added to the tox matrix (along with django 4.2 now that it's released). |
I added django 4.2. I haven't been able to get the tests to run psycopg 3 yet. https://github.com/bufke/django-bitfield/actions/runs/4631676030/jobs/8194831780?pr=1 |
Test tox psycopg3
The test should now use psycopg3 and fail on exactly 3 tests. That seems like an improvement. |
I'm not sure how to fix this or if it's even possible to fix. I don't think I have the time to address this. On my brief research I think there are two problems.
This monstrosity fixes some errors if we edit django's psycopg_any
With that we get one less error. We might need a Loader for it to work fully. Before the adapter was set globally on |
Fixes #130
Python 3.5/6/7 CI failure is not related and probably should be removed.
I'm not sure how to run tests locally and add a tox configuration that actually tests Django 4.2 with psycopg3. I tested this by running it on another Django project I maintain.